package com.gitee.starblues.grape.core.exception;

public enum ChailvErrorCode {
    SUCCESS(1800000, "请求成功"),
    FAILURE(1800001, "失败"),
    ILLEGAL_PARAM_ERROR(1800002, "非法请求参数"),
    SYSTEM_ERROR(1800003, "系统错误"),
	DUPLICATE_REQUEST(1800004,"重复请求"),
	ACCOUNT_NOT_EXIST(1800005,"账户信息不存在"),
	DRAW_AMOUNT_ERROR(1800006,"金额输入错误"),
	DRAW_AMOUNT_LESS(1800007,"金额需大于1元");;

	
    private int code;
    private String msg;

    ChailvErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ChailvErrorCode getEnum(int code) {
        ChailvErrorCode[] values = ChailvErrorCode.values();
        for (ChailvErrorCode value : values) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
